import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

Router.prototype.goBack = function () {
  this.go(-1)
}
// keepAlive缓存 isBack返回 require权限
export default new Router({
  routes: [
    {
      path: '/index',
      name: 'index',
      component: (resolve) => require(['@/pages/home/index'], resolve),
      meta: {
        keepAlive: true
      }
    },
    {
      path: '*',
      redirect: '/index'
    }
  ]
})
